import Vue from 'vue'
import App from './App.vue'
import router from './router'
import axios from 'axios'
axios.defaults.baseURL = 'https://autumnfish.cn/'
Vue.prototype.$http = axios
Vue.config.productionTip = false

import '../../assets/mobile/global.css'

import {
	Tab,
	Tabs,
	Swipe,
	SwipeItem,
	Lazyload,
	List,
	Cell,
	CellGroup,
	Toast,
	NavBar,
	Search,
	Sticky
} from 'vant'

Vue.use(Tab);
Vue.use(Tabs);
Vue.use(Swipe);
Vue.use(SwipeItem);
Vue.use(Lazyload);
Vue.use(List);
Vue.use(Cell);
Vue.use(CellGroup);
Vue.use(Toast);
Vue.use(NavBar);
Vue.use(Search);
Vue.use(Sticky);

Vue.filter('dateFormat', function(originVal) {
	const dt = new Date(originVal)

	const y = dt.getFullYear()
	const m = (dt.getMonth() + 1 + '').padStart(2, '0')
	const d = (dt.getDate() + '').padStart(2, '0')

	const hh = (dt.getHours() + '').padStart(2, '0')
	const mm = (dt.getMinutes() + '').padStart(2, '0')
	const ss = (dt.getSeconds() + '').padStart(2, '0')

	return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
})
new Vue({
	router,
	render: h => h(App)
}).$mount('#app')
